package org.example.aidemo.consumer;

import org.example.aidemo.pojo.EmailMessage;
import org.example.aidemo.service.common.QQEmailService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmailConsumer {
    @Autowired
    private QQEmailService qqEmailService;

    @RabbitListener(queues = "email.queue")
    public void handleEmailMessage(EmailMessage emailMessage) {
        qqEmailService.sendSimpleEmail(emailMessage);
    }
}
